import {
	request,
} from '@/api/request';
const apiList = [
	{
		// /api/sale/saleindex
		name: 'saleindex',
		url: '/api/sale/saleindex',
		method:'GET',
		showlod:true
	},
	{
		// /api/sale/saleindex
		name: 'arealist',
		url: '/api/area/list',
		method:'GET',
		showlod:true
	},
	{
		// /api/index/list
		name: 'indexlist',
		url: '/api/index/list',
		method:'GET',
		showlod:true
	},
	{
		// /api/help/config
		name: 'config',
		url: '/api/help/config',
		method:'GET',
		showlod:true
	},
	{
		// /api/help/add
		name: 'helpadd',
		url: '/api/help/add'
	},
	{
		// /api/news/type
		name: 'newstype',
		url: '/api/news/type',
		method:'GET',
		showlod:true
	},
	{
		// /api/news/list
		name: 'newslist',
		url: '/api/news/list',
		method:'GET',
	},
	{
		// /api/news/info
		name: 'newsinfo',
		url: '/api/news/info',
		method:'GET',
	},
	{
		// /api/notice/sys_list
		name: 'sys_list',
		url: '/api/notice/sys_list',
		method:'GET',
	},
	{
		// /api/index/admin_area
		name: 'admin_area',
		url: '/api/index/admin_area',
		method:'GET',
	},
	{
		// /api/check/area
		name: 'checkarea',
		url: '/api/check/area',
	}
]


module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data, token) => request({
		url: params.url,
		method: params.method || 'POST',
		data,
		token,
		showlod:params.showlod
	})
	return mode
}, {})